package com.lanyanhua.job.entity;

import lombok.Data;

import java.io.Serializable;

/**
 * @Auther: lanyanhua
 * @Date: 2018/9/13 0013 11:56
 * @Description:
 */
@Data
public class Result<T> implements Serializable{

    private boolean success;

    private String errorCode;

    private String message;

    private T data;


    public Result() {
        super();
    }
    /**
     * 错误
     */
    public Result(String errorCode, String message) {
        super();
        this.success = false;
        this.errorCode = errorCode;
        this.message = message;
    }
    /**
     * 错误
     */
    public Result(String message) {
        super();
        this.success = false;
        this.message = message;
    }

    public Result(boolean success, String errorCode, String message, T data) {
        super();
        this.success = success;
        this.errorCode = errorCode;
        this.message = message;
        this.data = data;
    }
    /**
     * 返回消息
     */
    public Result(boolean success,String message) {
        super();
        this.success = success;
        this.message = message;
    }

    /**
     * 成功
     */
    public Result(T data) {
        super();
        this.success = true;
        this.data = data;
    }

    /**
     * 成功
     */
    public Result( String message, T data) {
        this.success = true;
        this.message = message;
        this.data = data;
    }

    public Result(boolean success, String errorCode, String message) {
        super();
        this.success = success;
        this.errorCode = errorCode;
        this.message = message;
    }

    public Result(boolean success, String message, T data) {
        super();
        this.success = success;
        this.message = message;
        this.data = data;
    }

}